﻿requirejs.config({
    baseUrl: "../../scripts/lib",
    //path可以包含文件和目录
    paths: {
        text: "require/text",
        durandal: "durandal/js",
        plugins: "durandal/js/plugins",
        transitions: "durandal/js/transitions",
        knockout: "knockout/knockout-3.5.0.debug",
        bootstrap: "bootstrap/js/bootstrap",
        jquery: "jquery/jquery-1.12.4",
        ps: "perfect-scrollbar-0.8.1/js/perfect-scrollbar.jquery",
        components: "components",
        //指定文件夹
        d1:"../../1"
    },
    shim: {
        bootstrap: {
            deps: ["jquery"],
            exports: "jQuery",
        },
        ps: {
            deps: ["jquery"],
            exports: "jQuery",
        },
    },
});

define([
    "durandal/system",
    "durandal/app",
    "durandal/viewLocator",
    "knockout",
], function (system, app, viewLocator, ko) {
    //>>excludeStart("build", true);
    system.debug(true);
    //>>excludeEnd("build");

    app.title = "Durandal Framework";

    app.configurePlugins({
        router: true,
        dialog: true,
    });

    // export to window
    window.ko = ko;

    app.start().then(function () {
        //Replace 'viewmodels' in the moduleId with 'views' to locate the view.
        //Look for partial views in a 'views' folder in the root.
        viewLocator.useConvention();

        //Show the app by setting the root view model for our application with a transition.
        app.setRoot("d1/app/viewmodels/shell", "entrance");
    });
});
